package net.hn.hnms.biz.safety.wind.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.safety.wind.Service.*;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import net.hn.hnms.biz.safety.wind.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 智呈物联 nzw
 * @date 2022/12/19
 */
@RestController
@RequestMapping("safety/riskWarning/flood/zntf")
@Api(value = "智能通风模块", tags = {"智能通风"})
public class SmartVentilationController {

    private WindResistanceService windResistanceService;

    private WindWindowService windWindowService;

    private WindDoorService windDoorService;

    private AirVolumeService airVolumeService;

    private DevicefaultService devicefaultService;

    @Autowired
    public void setWindResistanceService(WindResistanceService windResistanceService) {
        this.windResistanceService = windResistanceService;
    }

    @Autowired
    public void setWindWindowService(WindWindowService windWindowService) {
        this.windWindowService = windWindowService;
    }

    @Autowired
    public void setWindDoorService(WindDoorService windDoorService) {
        this.windDoorService = windDoorService;
    }

    @Autowired
    public void setAirVolumeService(AirVolumeService airVolumeService) {
        this.airVolumeService = airVolumeService;
    }

    @Autowired
    public void setDevicefaultService(DevicefaultService devicefaultService) {
        this.devicefaultService = devicefaultService;
    }

    @ApiOperation("通风参数")
    @GetMapping("/findResistance")
    @AutoSetMineCode
    public R<List<WindResistanceVO>> findResistance(String mineCode){
        return R.ok(windResistanceService.findWindResistance(mineCode));
    }

    @ApiOperation("风窗")
    @GetMapping("/findWindWindow")
    @AutoSetMineCode
    public R<List<WindWindowVO>> findWindWindow(String mineCode){
        return R.ok(windWindowService.findWindWindow(mineCode));
    }

    @ApiOperation("风门")
    @GetMapping("/findWindDoor")
    @AutoSetMineCode
    public R<List<WindDoorVO>> findWindDoor(String mineCode){
        return R.ok(windDoorService.findWindDoor(mineCode));
    }

    @ApiOperation("风速风量情况")
    @GetMapping("/findAirVolume")
    @AutoSetMineCode
    public R<List<AirVolumeVO>> findAirVolume(String mineCode){
        return R.ok(airVolumeService.findAirVolume(mineCode));
    }

    @ApiOperation("异常情况")
    @GetMapping("/findDevicefault")
    @AutoSetMineCode
    public R<List<DevicefaultVO>> findDevicefault(String mineCode){
        return R.ok(devicefaultService.findDevicefault(mineCode));
    }
}
